package com.china08.yxyapi.repository.db.huixue.comm;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.china08.yxyapi.entity.db.questionbank.YxyQuesbankVersion;

public interface YxyQuesbankVersionRepository extends JpaRepository<YxyQuesbankVersion, String> {

    @Query(value = " select t1.subjectId from YxyQuesbankVersion t1 where t1.stageId = ?1 and t1.status = 1 group by t1.subjectId")
    List<String> findSubjectIdByStageIdGroupBySubjectId(String phase);

    List<YxyQuesbankVersion> findByStageIdAndSubjectIdAndStatusOrderByOrderNum(String phase, String subject,
            Integer status);

}
